1. Field
The disclosure relates generally to data processing and more specifically to counting events by thread groups in processors running a multitude of threads.
2. Description of Related Art
Chips may contain multiple processors and may be capable of handling a large number of threads. Typically, processor chips have built-in performance instrumentation that monitors various performance-related events occurring during operation of the chip.
Performance instrumentation consists of performance monitor units that provide counters, support for selecting and routing event signals to those counters, and registers to hold sampled instruction addresses. Performance monitor units may also interrupt one or more processors when a trigger condition is met. For example, interruption of a thread on a processor may be necessary when a counter overflows to support instruction sampling. An interrupt signal to the processor may be used to freeze a register that holds the address of an instruction that is executing at the time the trigger condition occurred, or that has recently completed execution. To support monitoring of performance events on all threads and processor cores, a performance monitor unit is provided per thread, or counters are shared among multiple threads or processor cores.
Per thread performance event counting is used to count events by thread. Counting on a per thread basis is required for instruction sampling. When there are many processor cores and threads in a chip, many counters are required to perform application-wide event counting. The larger amount of counters takes up a larger amount of space in the chip.
Per processor core performance event counting of events generated by a processor core may be performed without attributing the events to any thread or subset of threads. While per processor core performance events reduce the number of counters required, per processor core performance event counting cannot provide application wide counting because it is not possible to attribute events to a subset of threads when a processor core's threads are running a mix of threads for a mix of applications. Another category of events may count events generated by any thread. An example of counting events generated by any thread may be events occurring in shared resources that can be accessed by threads on multiple processor cores.